<div class="main">
			<div class="shop-l">
				<h2>Lọc sản phẩm</h2>
                <ul class="filter">
                	<li class="top">Chọn theo mức giá</li>
                	<li>
                    	<a href="<?php echo base_url().'gian-hang/price_max/0-5.html'?>">Dưới 5 triệu</a>
                    	<?php $total_products = $this->home_model->count_all_products_by_price(0,5);?> 
                    	(<?php echo $total_products[0]->sum_products;?>)
                    </li>
                    <li>
                        <a href="<?php echo base_url().'gian-hang/price_max/5-7.html'?>">5 triệu - 7 triệu</a> 
                        <?php $total_products = $this->home_model->count_all_products_by_price(5,7);?> 
                    	(<?php echo $total_products[0]->sum_products;?>)
                    </li>
                    <li>
                        <a href="<?php echo base_url().'gian-hang/price_max/7-10.html'?>">7 triệu - 10 triệu </a> 
                        <?php $total_products = $this->home_model->count_all_products_by_price(7,10);?> 
                    	(<?php echo $total_products[0]->sum_products;?>)
                    </li>
                    <li>
                        <a href="<?php echo base_url().'gian-hang/price_max/10-12.html'?>">10 triệu - 12 triệu</a> 
                        <?php $total_products = $this->home_model->count_all_products_by_price(10,12);?> 
                    	(<?php echo $total_products[0]->sum_products;?>)
                    </li>
                    <li>
                        <a href="<?php echo base_url().'gian-hang/price_max/12-0.html'?>">Trên 12 triệu </a> 
                        <?php $total_products = $this->home_model->count_all_products_by_price(12,0);?> 
                    	(<?php echo $total_products[0]->sum_products;?>)
                    </li>
                    
                    <li class="top">Thương hiệu</li>
                    <?php if(isset($company) && $company != null ){?>
                    <?php foreach($company as $k => $v) {?>
                    	<li>
                    		<a href="<?php echo base_url().'gian-hang/company/'.$v->name_link.'.html'?>" title="<?php echo $v->name;?>"><?php echo $v->name;?></a> 
                    		<?php $total_products = $this->home_model->count_product_by_company($v->id);?>
                    		(<?php echo $total_products[0]->sum_products;?>)
                    	</li>
                    <?php }?>
                    <?php }?>
                    
                    <li class="top">Chọn theo công suất</li>
                    <li>
                    	<a href="<?php echo base_url().'gian-hang/power/0-9.html'?>">Đến 9000 BTU</a> 
                    	<?php $total_products = $this->home_model->count_products_by_power(0,9);?> 
                    	(<?php echo $total_products[0]->sum_products;?>)
                    </li>
                    <li>
                    	<a href="<?php echo base_url().'gian-hang/power/9-10.html'?>">Đến 10.000 BTU</a> 
                    	<?php $total_products = $this->home_model->count_products_by_power(9,10);?> 
                    	(<?php echo $total_products[0]->sum_products;?>)
                    </li>
                    <li>
                    	<a href="<?php echo base_url().'gian-hang/power/10-12.html'?>">Đến 12.000 BTU</a> 
                    	<?php $total_products = $this->home_model->count_products_by_power(10,12);?> 
                    	(<?php echo $total_products[0]->sum_products;?>)
                    </li>
                    <li>
                    	<a href="<?php echo base_url().'gian-hang/power/12-13.html'?>">Đến 13.000 BTU </a> 
                    	<?php $total_products = $this->home_model->count_products_by_power(12,13);?> 
                    	(<?php echo $total_products[0]->sum_products;?>)
                    </li>
                    <li>
                    	<a href="<?php echo base_url().'gian-hang/power/13-18.html'?>">Đến 18.000 BTU </a> 
                    	<?php $total_products = $this->home_model->count_products_by_power(13,18);?> 
                    	(<?php echo $total_products[0]->sum_products;?>)
                    </li>
                    <li>
                    	<a href="<?php echo base_url().'gian-hang/power/18-24.html'?>">Đến 24.000 BTU</a> 
                    	<?php $total_products = $this->home_model->count_products_by_power(18,24);?> 
                    	(<?php echo $total_products[0]->sum_products;?>)
                    </li>
                    <li>
                    	<a href="<?php echo base_url().'gian-hang/power/24-30.html'?>">Đến 30.000 BTU</a> 
                    	<?php $total_products = $this->home_model->count_products_by_power(24,30);?> 
                    	(<?php echo $total_products[0]->sum_products;?>)
                    </li>
                    
                    <li class="top">Công năng sử dụng</li>
                    <?php if(isset($utilities) && $utilities != null) {?>
                    <?php foreach($utilities as $k => $v) {?>
                    	<li>
                    		<a href="<?php echo base_url().'gian-hang/su-dung/'.$v->name_link.'.html'?>" title="<?php echo $v->name;?>">
                    			<?php echo $v->name;?>
                    		</a>
                    		<?php $total_products = $this->home_model->count_products_by_utilities_id($v->id);?> 
                    			(<?php echo $total_products[0]->sum_products;?>)
                    	</li>
                        <?php }?>                        
                    <?php }?>
                </ul>
            </div>
            <div class="shop-r">
            	<div class="top-shop">
                	<span>Có <b><?php echo $num_rows;?></b> sản phẩm  |  Sắp xếp theo</span>
                	<form name="form_sort_order"> 
                    <select name="order_type" style="margin:3px 0 0 5px;" onChange="">
                    	<option value="1">Sắp xếp theo thứ tự</option>
                        <option value="2">Giá từ thấp đến cao</option>
                        <option value="3">Giá từ cao xuống thấp</option>
                    </select>
                    </form>
                </div>
                
                <?php if(isset($all_products) && $all_products != null) {?>
                <?php foreach($all_products as $k => $v) {?>
                <div class="line-shop">                	
                	<a href="<?php echo base_url().'gian-hang/detail/'.$v->id.'/'.$v->name_link.'.html';?>">
                		<?php $img_path = $this->home_model->get_images_products_by_product_id($v->id);?>
                		<?php if(isset($img_path) && $img_path != null) {?>
                			<img src="<?php echo site_url($img_path[0]->img_path);?>" title="<?php echo utf8_to_ascii($v->name);?>" alt="<?php echo utf8_to_ascii($v->name);?>" class="thumb" />
                		<?php } else {?>
                			<img src="<?php echo img_link('no_image.gif');?>" title="" alt="" class="thumb" />
                		<?php }?>
                	</a>
                    <div class="infosp-r">
                        <h2><a href="<?php echo base_url().'gian-hang/detail/'.$v->id.'/'.$v->name_link.'.html';?>" title="<?php echo $v->name;?>"><?php echo $v->name;?></a></h2>
                        <ul>
                            <li>Mã sản phẩm: <?php echo $v->code;?></li>
                            <li>Thương hiệu: <?php echo $v->company_name;?></li>
                            <li>Xuất xứ: <?php echo $v->country;?></li>
                            <li>Công suất: <?php echo $v->electric_power;?> BTU</li>
                            <li>Bảo hành: <?php echo $v->warranty;?> năm</li>
                            <li>Loại: <?php echo $v->dimension;?> chiều</li>	
                        </ul>
                    </div>
                    <div class="price">
                        <font class="pr">Giá: <?php echo format_type_money($v->price);?> VNĐ</font><br />(Đã bao gồm VAT)
                        <p><a href="<?php echo base_url().'dat-hang-lien-he/dat-hang/'.$v->code;?>" class="btn-dat">Đặt hàng</a></p>
                    </div>
                </div>
                <?php }?>
                <?php } else {?>
                <div class="line-shop"><font color="red">Không tìm thấy sản phẩm nào phù hợp!</font></div>
                <?php }?>
                                
                <div class="pagination panaging">                
                    <?php echo $pagnav;?>
                </div>
                
            </div>
        </div>